function T = dynamic_resid_tt(T, y, x, params, steady_state, it_)
% function T = dynamic_resid_tt(T, y, x, params, steady_state, it_)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double  vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double  vector of endogenous variables in the order stored
%                                                    in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double  matrix of exogenous variables (in declaration order)
%                                                    for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double  vector of steady state values
%   params        [M_.param_nbr by 1]        double  vector of parameter values in declaration order
%   it_           scalar                     double  time period for exogenous variables for which
%                                                    to evaluate the model
%
% Output:
%   T           [#temp variables by 1]       double  vector of temporary terms
%

assert(length(T) >= 20);

TEF_0 = int_capital(y(44),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(13),params(14));
T(1) = TEF_0;
TEF_1 = int_profit(y(44),y(21),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(2),params(13),params(14),params(4));
T(2) = TEF_1;
TEF_2 = int_money(y(44),y(21),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(2),params(13),params(14),params(4));
T(3) = TEF_2;
T(4) = params(1)/y(54)*(1-params(4))*y(53);
T(5) = params(52)+y(52)*params(10)*(1-params(9))*y(55)+params(12)*params(9)*y(52)*params(10)*(1-params(8))*y(56)+params(14)*params(9)*y(52)*params(10)*y(57);
T(6) = y(21)/y(51)/(1-params(3));
T(7) = (log(y(45))-params(20))/params(21)/1.414213562373095;
TEF_3 = average_log_normal(y(45),params(20),params(21));
T(8) = TEF_3;
TEF_4 = int_acquisition(y(44),y(21),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(2),params(13),params(14),params(4));
T(9) = TEF_4;
T(10) = (params(3)/y(37))^(1/(1-params(3)));
T(11) = y(51)*T(10);
T(12) = y(51)^(1-params(3));
T(13) = y(30)*T(12);
T(14) = y(1)^(1-params(3));
T(15) = y(34)^params(3);
TEF_5 = int_2nd_price(y(44),y(21),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(2),params(4));
T(16) = TEF_5;
TEF_6 = int_prod_disp(y(44),y(21),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(2),params(4),params(10)*y(14));
T(17) = TEF_6;
TEF_7 = int_liq(y(44),y(21),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(2),params(12),params(13),params(14),params(4),0);
T(18) = TEF_7;
TEF_8 = int_surplus(0,1,y(21),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(2),params(13),params(14),params(12),params(4));
T(19) = TEF_8;
TEF_9 = int_partial(y(44),y(21),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(2),params(12),params(13),params(14),params(4),0);
T(20) = TEF_9;

end
